#ifndef ZHY_MUDUO_BASE_COUNTDOWNLATCH_H
#define ZHY_MUDUO_BASE_COUNTDOWNLATCH_H

#include "Condition.h"
#include "Mutex.h"

namespace _zhy_muduo
{
class CountDownLatch{
public:
	explicit CountDownLatch(const int count);
	void wait();
	void countDown();
	int getCount() const;

private:	
	mutable MutexLock mutex_;
	Condition condition_;
	int count_;
	DISALLOW_COPY_AND_ASSIGN_11(CountDownLatch);
};
}

#endif //ZHY_MUDUO_BASE_COUNTDOWNLATCH_H
